package slap.util;

import java.util.HashMap;
import java.util.Map;

import org.perf4j.LoggingStopWatch;
import org.perf4j.StopWatch;

public class Perf4j {
	
	private static Map<String, StopWatch> watchers = new HashMap<String, StopWatch>(10);
	
	public static void start(String name){
		StopWatch sw = watchers.get(name);
		if(sw == null){
			sw = new LoggingStopWatch();
		}
		sw.start();
		watchers.put(name, sw);
	}
	
	public static void stop(String name, String tag){
		StopWatch sw = watchers.get(name);
		sw.stop(tag);
	}
	
}
